export interface EnumProps {
  label: string; // 选项框显示的文字
  value: any; // 选项框值
  locale?:{[key: string]:string},
  disabled?: boolean; // 是否禁用此选项
  children?: EnumProps[]; // 为树形选择时，可以通过 children 属性指定子选项
}

export type SearchType =
  | 'text'
  | 'select'
  | 'number'
  | 'switch'
  | 'slider'
  | 'radio'
  | 'checkbox'
  | 'rate'
  | 'date'
  | 'rangeDate'
  | 'time'
  | 'treeSelect'
  | 'textarea'

export interface ColumnProps {
  // hiddenRule: (params: any) => boolean; // 在表格中是否隐藏此列
  // hideItem:boolean; // 筛选条件是否隐藏此列

  hidden:boolean,
  dataIndex: string; //
  ellipsis: boolean; // 超出省略
  title: string; // 单元格标题
  width: number | string; // 列宽
  dic:string|any[]; // 字典数据表
  // sortable: boolean; // 是否可排序（静态排序）
  fixed: 'left' | 'right'; // 固定列
  search: boolean; // 是否为搜索项
  searchType: SearchType; // 搜索项类型
  searchProps: { [key: string]: any }; // 搜索项参数，根据 antdv 文档来，标签自带属性 > props 属性
  searchInitParam: string | number | boolean | any[]; // 搜索项初始值
  enum: EnumProps[]; // 枚举类型（渲染值的字典）
  // sorter: { compare: Function; multiple: number }; // 排序
  align: 'center' | 'left';
  resizable: boolean;
  minWidth: number;
  maxWidth: number;
  customCell: (params: any) => any;
}


export type Pageable = {
  current: number;
  defaultPageSize?: number;
  hideOnSinglePage?: boolean;
  pageSize: number;
  total: number;
  pageSizeOptions?: string[];
  showTotal?: (params: number) => string;
}

export type TableStateProps = {
  loading: boolean;
  tableData: any;
  searchShow: boolean;
  pageable: Pageable;
  tableSize: string;
  searchParam: {
    [key: string]: any;
  };
  searchInitParam: {
    [key: string]: any;
  };
  totalParam: {
    [key: string]: any;
  };
  icon?: {
    [key: string]: any;
  };
}


export type TableSource = {
  current: number;
  pageSize: number;
  total: number;
  list: any[];
}


export type ColumnsType = Partial<ColumnProps>

export interface TableSortProps {
  sortIndex: [number | undefined, number | undefined];
  shouldSort: boolean;
}

export type mergeRow = number[][]
